import request from '@/utils/request'

export interface StaffData {
  userId: number;
  realName: string;
  phone: string;
  roleId: number;
  departmentId: number;
}

export function getStaffList(params: any) {
  return request({
    url: '/api/staff/staff/page',
    method: 'get',
    params
  })
}

export function deleteStaff(userId: number) {
  return request({
    url: `/api/staff/staff/${userId}`,
    method: 'delete'
  })
}

export function getRoleOptions() {
  return request({
    url: '/api/staff/roles/options',
    method: 'get'
  })
}

export function getDepartmentOptions() {
  return request({
    url: '/api/staff/departments/options',
    method: 'get'
  })
}

export function updateStaff(data: StaffData) {
  return request({
    url: '/api/staff/staff/update',
    method: 'put',
    data
  })
}
